#include "./lm_keyevent.h"

extern int _kbhit(void);
extern int _getch(void);

lm_keyboard_value_e lm_get_kb_value(void)
{
    int kb_value;
    if(_kbhit()) {
        kb_value = _getch();
        if(kb_value == 0 || kb_value == 224) { // if direction key
            return  _getch() + 200;
        }
        return (lm_keyboard_value_e)(kb_value);
    }
    return KEYBOARD_INVALID;
}
